#include "mythread.h"
#include<QDebug>
#include<QByteArray>
#include<tcpsocket.h>
myThread::myThread(QWidget *parent,qintptr p) : QThread(parent)
{
       this->ptr = p;

}

void myThread::run()
{
    qDebug()<<"新线程";
    tsocket = new Tcpsocket(0,this->ptr);
    if(!tsocket->setSocketDescriptor(this->ptr))
    {
        return;
    }
    connect(tsocket,&Tcpsocket::disconnected,this,&myThread::quit);


    connect(tsocket,SIGNAL(dataready(QString,QByteArray)),this,SLOT(t_recedata(QString,QByteArray)));


    connect(this,SIGNAL(t_datasend(int,QByteArray)),tsocket,SLOT(senddata(int,const QByteArray)));



            this->exec();

}



void myThread::t_recedata(QString d, const QByteArray arry)
{

}

